#ifndef CLOG_H
#define CLOG_H

#include <QObject>
#include <QFile>
#include <QTimer>
#include "module/chttpmanger.h"

class CLog : public QObject
{
    Q_OBJECT
public:

    static CLog *getSingle();
    void debugOutput(const QString &msg);

    void logOutput(QString msg);
    void requestRecordState();

signals:
    void s_log(QString msg);

public slots:
    void doFileSizeCheck();
    void doWriteLog(QString msg);

    int doRecordUpdate(QString d);
    void doRecordUpdateResult(QByteArray ret);
    void doRecordStateResult(QByteArray ret);
private:
    QFile *_logFile;
    CLog(QObject *parent = 0);
    QTimer timer;
    QString _cacheLog;
    QStringList _upList;
    CHttpManger *_httpRecord,*_httpRS;
};

#endif // CLOG_H
